/**计时器
 * @date   2011-5-1
 * @author tianye
 */
package cn.edu.dlut.WingGame.Tools;

public class TimeCounter {
	public long start = 0;
	public long now = 200;
	public long interval = 200;

	public void setInterval(float time) {
		interval = (long) time;
	}

	public void updateTimer() {
		now = System.currentTimeMillis();
	}

	public float getElapsed() {
		updateTimer();
		return now - start;
	}

	public boolean checkTimer() {
		if (getElapsed() >= interval)
			return true;
		else
			return false;
	}

	public void restartTimer() {
		start = System.currentTimeMillis();
	}
}
